package cn.touna.jss.modules.third.tx.enums;

import cn.touna.risk.api.domain.ResponseService;

/**
 * @Author:wuwc
 * @Description:
 * @Date:2018/3/20 13:17
 */
public enum TianXingEnum implements ResponseService {
    TX_TOKEN_ERR("TX_TOKEN_ERR", "token异常"),;

    private String code;
    private String desc;

    private TianXingEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static TianXingEnum getDesc(String code) {
        for (TianXingEnum cqr : TianXingEnum.values()) {
            if (cqr.getCode().equals(code)) {
                return cqr;
            }
        }
        return null;
    }

    public boolean equals(String code) {
        return this.code != null && this.code.equals(code);
    }

    public String getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }

    public String getResponseCode() {
        return this.code;
    }

    public String getResponseMessage() {
        return this.desc;
    }
}